package model;
/*
* 这里类表示数据库中Blog表的内容
* 没给Blog对象，就对应blog表中的一条记录
* */

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

public class Blog {
    private int bolgId;
    private String title;
    private String  content;
    private int userId;
    private Timestamp postTime;

    public int getBolgId() {
        return bolgId;
    }

    public void setBolgId(int bolgId) {
        this.bolgId = bolgId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getPostTime() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //format方法是用来转换时间戳为上述规定的格式。
        return format.format(postTime);
    }

    public void setPostTime(Timestamp postTime) {
        this.postTime = postTime;
    }
}
